<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.jd.ty.pojo" >
	<class name="CustomerOrder" table="COMPANY_ORDER" schema="TYMS">
		<id name="orderId" type="java.lang.Long">
			<column name="ORDER_ID" precision="10" scale="0" />
			<generator class="identity">
			</generator>
		</id>
		<many-to-one name="employee" class="Employee" fetch="select">
			<column name="EMPLOYEE_ID" precision="10" scale="0"
				not-null="true" />
		</many-to-one>
		<many-to-one name="customer" class="Customer" fetch="select" > 
			<column name="CUSTOMER_ID" precision="10" scale="0"
				not-null="true" />
		</many-to-one>
		<many-to-one name="customerCompany" class="CustomerCompany" fetch="select">
			<column name="CUSTOMER_COMPANY_ID" precision="10" scale="0"
				not-null="true" />
		</many-to-one>
		<property name="dealDate" type="timestamp">
			<column name="DEAL_DATE" />
		</property>
		<many-to-one name="projectType" class="Dictionary" fetch="select"
			lazy="false">
			<column name="PROJECT_TYPE_ID" precision="10" scale="0" />
		</many-to-one>
		<bag name="projectAttrValues" fetch="select" cascade="all" inverse="true"  lazy="false" >
			<key column="ORDER_ID"/>
			<one-to-many class="ProjectAttrValue"/>
		</bag>
	</class>
</hibernate-mapping>

